package com.company.dao;

import java.util.List;

import com.company.entity.Chanpinfuwu;
import com.company.entity.Projects;

public class PageProjectDao extends BaseDao<Projects> {

	int ProNum = 4;

	public int queryPageNum() {
		String sql = "from Projects";
		int NumOfPro = queryEntiys(sql).size();
		
		return NumOfPro % ProNum == 0 ? NumOfPro / ProNum : NumOfPro / ProNum
				+ 1;
	}

	public List<Projects> query(int PageNum) {
		String sql = "from Projects";
		return queryEntiysById(sql, (PageNum - 1) * ProNum);
	}

}
